#pragma once
class Fib {
public:
	Fib(int num) :n(num) {}
	int get()
	{
		int f = 0, g = 1;
		for (int i = 0; i < n; ++i)
		{
			g = f + g;
			f = g - f;
		}
		return g;
	}
	int pre()
	{
		return Fib(n--).get();
	}
	int next()
	{
		return Fib(n++).get();
	}

private:
	int n;
};